<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- 微软的老式浏览器 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <!-- 显示窗口 宽度 是 客户端的 屏幕 宽度 （就是 满屏 ！），显示的文字和图形的初始比例 是 1.0 -->
    <link rel="stylesheet" href="css/layui.mobile.css">
    <link rel="stylesheet" type="text/css" href="css/att.css">
    <script src="js/common.js"></script>
	<title>学历认证</title>
</head>
<body style="background-color: #fff;">
	<div class="hitop">
		<div class="tubiao"><img src="images/img/555.png" alt=""></div>
        <div class="lione"><a style="color:#000;">学历证</a></div>
        <div class="bigk">
            <div class="kuang">
                <div id="list"></div>
                <div class="addbox" id="upload-btn"></div>
                <p>请上传学历证明（可以上传多个学历证明哦）~</p>
            </div>
        </div>
        <div class="quetwo"><a  class="oktwo" onclick="rz()">提交审核</a></div>
    </div>
    <input style="display: none" type="file" id="file" accept="image/png,image/gif,image/jpeg,image/jpg">
    <script type="text/javascript" src="js/jquery/jquery.min.js"></script>
    <script src="js/jquery/upload.js"></script>
    <script src="js/jquery/layer.js"></script>
    <script src="js/utils.js"></script>
  <script>
      Utils.historyBack(function () {
          window.location.href = '/certification.html';
      });
      var img=[];
      new Upload({
          button :"#upload-btn",
          file : '#file',
          module : 'album',
          success : function (url) {
              //$(".kuang").html("");
              img.push(url);
              var strs=`<img src=${url}>`;
              $(strs).appendTo("#list");
          },
          error : function (data) {
              alert('网络错误');
          }
      });
      function rz() {
          $.ajax({
              type : "POST",
              url : getRequestUrl("/user/upload_auth_data"),
              data:{
                  auth_type:1,
                  data:img.toString()
              },
              success : function(datas) {
                  console.log(datas);
                  if(datas.response_params.result==0){
                      layer.open({
                          content: '学历证上传成功,等待系统审核',
                          time: 2,
                          skin:'msg'
                      });
                  }
              },
              error : function(err) {
            	  dealCPErrorResponse(err);
              }
          });
      }
 </script>
</body>
</html>